package com.yunhui.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunhui.entity.User;
import com.yunhui.mapper.UserMapper;
import com.yunhui.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * <p>
 *  用户的业务处理的层实现类
 * </p>
 *
 * @author WGH
 * @since 2019-12-09
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public User selectByPhoneOrEmail(String phone_email) {
        String phone = null;
        String email = null;

        if(phone_email.lastIndexOf(".")>-1){
            email = phone_email;
        }else{
            phone = phone_email;
        }

        return userMapper.selectByPhoneOrEmail(phone,email);
    }


}
